<html>
<head><meta charset="utf-8"><title>let ident: &amp;{unknown} = ...; · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/let.20ident.3A.20.26.7Bunknown.7D.20.3D.20.2E.2E.2E.3B.html">let ident: &amp;{unknown} = ...;</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="185511493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/let%20ident%3A%20%26%7Bunknown%7D%20%3D%20...%3B/near/185511493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/let.20ident.3A.20.26.7Bunknown.7D.20.3D.20.2E.2E.2E.3B.html#185511493">(Jan 13 2020 at 16:50)</a>:</h4>
<p>If I see <code>&amp;{unknown}</code> as the inferred type (and I've let the source sit idle for long enough that I imagine any pending analysis has completed), is that always a sign of some bug in Rust Analyzer? Or are there accepted limitations in its type inference that imply we do not classify such things as bugs, at least for now?</p>



<a name="185511773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/let%20ident%3A%20%26%7Bunknown%7D%20%3D%20...%3B/near/185511773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/let.20ident.3A.20.26.7Bunknown.7D.20.3D.20.2E.2E.2E.3B.html#185511773">(Jan 13 2020 at 16:53)</a>:</h4>
<p>I would classify it as a bug, yes</p>



<a name="185511926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/let%20ident%3A%20%26%7Bunknown%7D%20%3D%20...%3B/near/185511926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/let.20ident.3A.20.26.7Bunknown.7D.20.3D.20.2E.2E.2E.3B.html#185511926">(Jan 13 2020 at 16:54)</a>:</h4>
<p>it will likely be one of a number of known limitations or not-yet-implemented features, but maybe it isn't ;)</p>



<a name="185512015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/let%20ident%3A%20%26%7Bunknown%7D%20%3D%20...%3B/near/185512015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/let.20ident.3A.20.26.7Bunknown.7D.20.3D.20.2E.2E.2E.3B.html#185512015">(Jan 13 2020 at 16:55)</a>:</h4>
<p><span class="user-mention" data-user-id="129457">@Florian Diebold</span> don't we also produce legitimate unkonwns for type errors?</p>



<a name="185512083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/let%20ident%3A%20%26%7Bunknown%7D%20%3D%20...%3B/near/185512083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/let.20ident.3A.20.26.7Bunknown.7D.20.3D.20.2E.2E.2E.3B.html#185512083">(Jan 13 2020 at 16:56)</a>:</h4>
<p>Ie, another condition to classsify it is a bug would be that the code actually compiles</p>



<a name="185512325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/let%20ident%3A%20%26%7Bunknown%7D%20%3D%20...%3B/near/185512325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/let.20ident.3A.20.26.7Bunknown.7D.20.3D.20.2E.2E.2E.3B.html#185512325">(Jan 13 2020 at 16:58)</a>:</h4>
<p>ok yeah, assuming the compiler accepts the code</p>



<a name="185512822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/let%20ident%3A%20%26%7Bunknown%7D%20%3D%20...%3B/near/185512822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/let.20ident.3A.20.26.7Bunknown.7D.20.3D.20.2E.2E.2E.3B.html#185512822">(Jan 13 2020 at 17:03)</a>:</h4>
<p>(oh right, yeah; this is <code>rustc</code>-accepted code. Namely, its <code>rustc</code> itself...)</p>



<a name="185512869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/let%20ident%3A%20%26%7Bunknown%7D%20%3D%20...%3B/near/185512869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/let.20ident.3A.20.26.7Bunknown.7D.20.3D.20.2E.2E.2E.3B.html#185512869">(Jan 13 2020 at 17:03)</a>:</h4>
<p>so I'm not likely to reduce it down to a bug I can file anytime soon. Just curious.</p>



<a name="185513198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/let%20ident%3A%20%26%7Bunknown%7D%20%3D%20...%3B/near/185513198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/let.20ident.3A.20.26.7Bunknown.7D.20.3D.20.2E.2E.2E.3B.html#185513198">(Jan 13 2020 at 17:06)</a>:</h4>
<p>I think the biggest single source of unknowns currently are probably associated types, but there are also lots of other possible reasons (local imports, procedural macros, various missing details in trait solving and macro expansion)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>